//
//  ViewController.m
//  01-了解耗时操作
//
//  Created by 文锦 on 2017/7/7.
//  Copyright © 2017年 JunYun. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //1.获取主线程
    NSThread * mainThread=[NSThread mainThread];
    NSLog(@"%@",mainThread);
    
    //2.获得当前线程
    NSThread * currentThread=[NSThread currentThread];
    NSLog(@"获得当前线程%@",currentThread);
    
    //3.判断主线程
    //3.1 number ==1
    //3.2  类方法
       BOOL isMainThreadA= [NSThread isMainThread];
    //3.3 对象方法
    BOOL isMainThreadB=[currentThread isMainThread];
    
    NSLog(@"  %zd - %zd ",isMainThreadA,isMainThreadB);
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
